var React = require('react');
var ReactDOM = require('react-dom');

var AutoComplete = require('../../src/auto-complete.jsx');

var Comp1 = React.createClass({
    getInitialState: function () {
        return {
            input1: []
        };
    },
    render: function () {
        return <AutoComplete dataSource={["a", "ab", "abc", "abcd"]}
                             onUpdateInput={this.handleUpdateInput}
                             onNewRequest={this.handleNewRequest}/>;

    },
    handleUpdateInput: function (t) {
        console.log(t);
        this.setState({input1: [t, t + t, t + t + t]})
    },
    handleNewRequest: function (t) {
        console.log(request + " " + t)
    }
});

ReactDOM.render(<Comp1/>, document.getElementById("root"));